package com.ccx.coachsite.ui.own;

import com.ccx.coachsite.R;

import android.content.Context;
import android.widget.FrameLayout;

public class OwerMainView extends OwerMainBase {
	
	public static final String TAG = "OwerMainView";
	
	public OwerMainView(Context context, int paramInt) 
	{
		super(context);
		mContext = context;
		addMainView(R.layout.ower_main);

		rootViewId = R.id.ll_personal_info;
		rootLayout = (FrameLayout) findViewById(R.id.ower_main_frame);
		
		if(paramInt == 6)
		{
			isSetting = true;
			SwitchView(OwerViewKey.ll_personal_setting);
		}
		else
		{
			SwitchView(R.id.ll_personal_info);
		}
		initButton();
		myOwerView = new MyOwerView(context, this);
	}
	
	public void onBackClick()
	{
		super.onBackClick();
		switch (currentViewId) {
		case OwerViewKey.ll_personal_friend:
		case OwerViewKey.ll_personal_collect:
		case OwerViewKey.ll_personal_setting:
		case OwerViewKey.ll_personal_share:
		case OwerViewKey.ll_personal_message:
			PopViewById(currentViewId);
			SwitchView(R.id.ll_personal_info);
			break;
		case OwerViewKey.ll_personal_more_download:
		case OwerViewKey.ll_personal_more_repassword:
		case OwerViewKey.ll_personal_more_score:
		case OwerViewKey.ll_personal_more_suggest:
		case OwerViewKey.ll_personal_more_about:
			PopViewById(currentViewId);
			SwitchView(OwerViewKey.ll_personal_setting);
			break;
		case OwerViewKey.ll_personal_message_detail:
			PopViewById(currentViewId);
			SwitchView(OwerViewKey.ll_personal_message);
			break;
		case OwerViewKey.ll_personal_friend_detail:
		case OwerViewKey.ll_personal_add_friend:
			PopViewById(currentViewId);
			SwitchView(OwerViewKey.ll_personal_friend);
			break;
		default:

			break;
		}
	}
	
	protected OwerBaseView getCurrentView()
	{
		OwerBaseView baseView = super.getCurrentView();
		if(baseView != null)
			return baseView;
		
		switch (currentViewId) {
		case R.id.ll_personal_info:
			baseView = myOwerView;
			break;
		}
		
		return baseView;
	}
}
